473,441 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,441 software developers and data experts.

simple & drop-down combo/list box questions

Can someone tell me where in Properties to change a combobox/list from
simple to drop-down? I had it set to drop-down and couldn't remember
how to switch it back to simple. I don't know if it's being hidden.

The drop down listbox is named yachtLengthListBox, which should have
the list of 7 numbers already declared as constants, so I shouldn't
use the collection to enter them.

So I tried to use the statement
yachtLengthListBox.Items.Add(intLENGTH1.ToString() );
but it came up with an error. Am I allowed to put that code right
after the class-level variable declarations, and must I change some
property in yachtLengthListBox to do so?

--
Profile: http://mysite.verizon.net/vze8adrh/news.html
-Tim923 (Timothy Schmits)
Nov 16 '05 #1
2 4852
Hello Tim923,

How did you declare 7 numbers in constants? I'd use Enum or array int[] Numbers
= {1, 2, 3, 4, 5, 6, 7};

And you can't write code like yachtLengthListBox.Items.Add(intLENGTH1.ToString() );
at class level... You should have it on Form_Load or in its constructor.
So I'd do like this.

private int[] _Numbers = {1, 2, 3, 4, 5, 6, 7};
private void Form1_Load(object sender, System.EventArgs e)
{
foreach(int i in _Numbers)
comboBox1.Items.Add(i);
}

So about simple to dropdown... You're gonna figure that out yourself... Just
look into property window more carefully.
Can someone tell me where in Properties to change a combobox/list from
simple to drop-down? I had it set to drop-down and couldn't remember
how to switch it back to simple. I don't know if it's being hidden.

The drop down listbox is named yachtLengthListBox, which should have
the list of 7 numbers already declared as constants, so I shouldn't
use the collection to enter them.

So I tried to use the statement
yachtLengthListBox.Items.Add(intLENGTH1.ToString() );
but it came up with an error. Am I allowed to put that code right
after the class-level variable declarations, and must I change some
property in yachtLengthListBox to do so?
--
Profile: http://mysite.verizon.net/vze8adrh/news.html
-Tim923 (Timothy Schmits)

Nov 16 '05 #2
Thanks.

AllowDrop is the word. I was looking for DropDown.
--
Tim923, Static Profile: http://mysite.verizon.net/vze8adrh/news.html
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: srikanth | last post by:
Hi all, I have an requirement in one of my projects. We have one aspx page, in that we have two frames, in each frame having a tree structure control(dynamic data). In the left Frame we are...
1
by: Woody Rao | last post by:
I'm trying to drop all indexes and primary keys so that i can rebuild them (from a script created from same database on another server). when i go to the 'generate sql scripts', it has the...
0
by: K Finegan | last post by:
I have an archival process on a large database that runs once a month. At the beginning of the process the triggers and indexes on the tables whose data is moved are dropped, the data is moved and...
0
by: Plumer | last post by:
Hello everyone, Yesterday I posted a message about implementing drag & drop in a TreeView control. I'm having real difficulty getting this to work -- the process seems to be incredibly...
2
by: Ivo Tcholakov | last post by:
Is it possible to drag and drop controls in an aspx page at runtime ? Meaning i have developed a ASP.NET web form, the web form is now downloaded in IE - now can i have this form to detect mouse...
3
by: VB Programmer | last post by:
In VB.NET 2005 (winform) any sample code to drag & drop items between 2 listboxes? Thanks!
2
by: misower | last post by:
var c = document.getElementById("PanelTree"); // PanelTree is a <div> element! var n = document.createElement("div"); n.setAttribute('id', 'nu'); n.setAttribute('style',...
5
by: sesar | last post by:
How can I impement drag&drop for simple 'dialog base' application... I want to drag&drop txt file and load the text to variable
5
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with...
1
by: patrickq | last post by:
What am trying to achieve is dragging an element from one IFRAME/FRAME into another IFRAME/FRAME. But upon dropping the element, I do not want the target IFRAME/FRAME to open/load it. I want to set...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.